Skip to content

fix: security audit of board verification, scanning invariants, and privacy tiers (closes #18) - #60

Draft
s6pa1rta3n-lab wants to merge 1 commit into
mxx1111:mainfrom
s6pa1rta3n-lab:fix-issue
Draft

fix: security audit of board verification, scanning invariants, and privacy tiers (closes #18)#60
s6pa1rta3n-lab wants to merge 1 commit into
mxx1111:mainfrom
s6pa1rta3n-lab:fix-issue

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

What changed / 改了什么

Closes #18

This pull request implements the comprehensive security hardening and audit fixes for the repository and ledger verification engine:

  1. Refund Recipient Invariant: Fixed verify.mjs so refund operations must return funds directly to the original from account that established the escrow.
  2. Escrow Ownership Protection: Prevents escrow takeovers by requiring subsequent escrows on the same ref to match the original funder.
  3. Canonical Settlement Evidence Validation: Added ledger/pr-evidence.mjs requiring settlement evidence to be canonical GitHub PR URLs referencing the task, verified as merged or closed/accepted, with valid non-future event timestamps preceding ledger settlement.
  4. Scanner Hardening & Fail Closed: Updated scripts/scan-repo.mjs to use execFileSync with NUL-delimited output (git ls-files -z) and fail closed (throw) when encountering unreadable tracked files.
  5. GitHub Actions Annotation Escaping: Sanitized workflow command control characters (%, \r, \n, :, ,) to prevent command injection in annotations.
  6. Strict Allowlist Format: Enforced exact line matching (rule-id:path:line) in .github/scan-allow.txt, dropping wildcard suppression rules.
  7. P2 Privacy Tier Realism: Corrected documentation in PRIVACY-TIERS.md and project docs to accurately reflect P2 as temporary trusted access with copyable source rather than unachievable zero-disk guarantees.

Acceptance Criteria Checklist

  • npm test passes (all 50 unit and integration tests across verifier, scanner, stats, pricing, and pr-evidence pass).
  • npm run ledger replays the 27 historical entries with all 11 invariants holding.
  • npm run ledger:prs verifies historical settlement pull requests.
  • npm run scan reports 0 blocking issues.
  • Zero mock assertions used; unmocked deterministic test suites included.
  • No ledger amount, type, account, or balance changed.

Attestation / 声明

  • I reviewed every line of this change myself and I understand it.
  • I used my own subscription account and shared no credentials with anyone.
  • I did not route anyone else's requests through my account.
  • This PR contains no credentials, API keys, tokens, or secrets.

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

…anning (closes mxx1111#18)

- Enforce refund binding to original escrow funder
- Enforce escrow ownership to prevent hostile takeover
- Validate settle evidence against canonical GitHub PR URLs and task references
- Implement NUL framing in scan-repo and fail-closed on unreadable files
- Escape GitHub Actions annotation commands
- Enforce exact-line allowlist matching
- Correct P2 privacy tier documentation to temporary trusted access
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
这个 PR 已经 7 天没有新提交、作者也没有回复,它关联任务上的托管因此一直被占着,既不结算也不释放。

PR 不会被关闭——这是你的工作,随时可以接着做。被释放的只是任务上的认领,任务重新开放给其他人。

如果你还在做,回一句就行。

No commits or author replies for 7 days. The claim is released; this PR stays open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] Security audit of the board itself — retroactive for #17

1 participant